
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports _2bMatesSite.BO

Namespace _2bMatesSite
	''' <summary>
	''' Summary description for photo_album_comments_confirmation.
	''' </summary>
	Public Partial Class photo_album_comments_confirmation
		Inherits BaseWebPage
		Private imgID As Integer = -1
		Private usrID As Integer = -1
		Private grpID As Integer = -1
		Private isConfirmed As String = "no"
		Protected htPageConstants As New Hashtable()

		Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
			' this.pageTemplate.PageTitle = PageTitles.PHOTO_ALBUM_COMMENTS_CONFIRMATION_PAGE;
			' Put user code to initialize the page here
			' init page from XML
			Me.initPageTitles(Constants.PHOTO_ALBUM_COMMENTS_CONFIRMATION_PAGE, "", Form1, Nothing, htPageConstants)
			Me.initAdvertisements(Form1, Nothing)

			Try
				imgID = Convert.ToInt32(Request.Params("img"))
				Dim usr As User
				lblConfirmText.Visible = False

				If Request.Params("usr") = Nothing Then
					usr = LoggedUser
				Else
					usrID = Convert.ToInt32(Request.Params("usr"))
					usr = Users.GetUserByID(usrID)
				End If
				If Request.Params("grpID") <> Nothing AndAlso Request.Params("grpID") <> "" Then
					grpID = Convert.ToInt32(Request.Params("grpID"))
				End If

				isConfirmed = Request.Params("conf")

				If Not IsPostBack Then
					If isConfirmed = "yes" Then
						lblConfirmText.Visible = True

						If Not usr.ApproveComments Then
							lblConfirmTextApprove.Visible = True
						End If
					Else
						lblConfirmText.Visible = True
						If LoggedUser.ID = usrID Then
							lblConfirmText.Text = Me.GetPageConstText(htPageConstants, "CONST_MsgOneself_TEXT")
						Else
							lblConfirmText.Text = Me.GetPageConstText(htPageConstants, "CONST_MsgNoFriend_TEXT")
						End If
					End If
					If grpID <> -1 Then
						Dim grp As Group = Groups.GetGroupByID(grpID)
						If grp = Nothing Then
							Throw New Exception(Constants.ERROR_MESSAGE_MISSING_PARAMETERS)
						End If

						If Not grp.AutoApproveComments Then
							lblConfirmTextApprove.Visible = True
						End If

						trUserShortCut.Visible = False
					Else
						If usr <> Nothing AndAlso usr.ID <> LoggedUser.ID Then
							ucMemberShortcut.UserID = usr.ID
						Else
							trUserShortCut.Visible = False
						End If
					End If
				End If
			Catch
				Throw New Exception(Constants.ERROR_MESSAGE_MISSING_PARAMETERS)
			End Try
		End Sub

		#region Web Form Designer generated code
		Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)
			'
			' CODEGEN: This call is required by the ASP.NET Web Form Designer.
			'
			InitializeComponent()
			MyBase.OnInit(e)
		End Sub

		''' <summary>
		''' Required method for Designer support - do not modify
		''' the contents of this method with the code editor.
		''' </summary>
		Private Sub InitializeComponent()

		End Sub
#End Region

		Protected Sub btnBack_Click(ByVal sender As Object, ByVal e As System.EventArgs)
			If grpID <> -1 Then
				Response.Redirect(Constants.VIEW_GROUP_PHOTOS + "?" + Constants.GROUP_PARAM + "=" + grpID)
			Else
				Response.Redirect(Constants.VIEW_MEMBER_PHOTOS_PAGE + "?id=" + usrID)
			End If
		End Sub

		====================
		' This public property was added by conversion wizard to allow the access of a protected, autogenerated member variable Form1.
		====================
		Public ReadOnly Property Form1() As System.Web.UI.HtmlControls.HtmlForm
			Get
				Return Migrated_Form1
			End Get
		End Property
		'set { Migrated_Form1 = value; }
	End Class
End Namespace






